package com.huluobo.a2204monthparkdemo.news

import androidx.lifecycle.MutableLiveData
import com.huluobo.base.mvvm.BaseViewModel
import com.huluobo.base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import okhttp3.RequestBody
import javax.inject.Inject

/**
 *  Created by LC on 2024/9/7.
 */
@HiltViewModel
class NewsViewModel @Inject constructor(
    val apiService: ApiService
) : BaseViewModel() {
    val getAllNewsSuccess by lazy { MutableLiveData<String>() }
    fun getAllNews(body: RequestBody) {
        executeNetRequest(
            { apiService.getAllNews(body) },
            getAllNewsSuccess::postValue
        )
    }
}